import java.util.Scanner;

/**
 * @FileName Question5
 * @Description
 * @Author Sword
 * @date 2024-09-26
 **/
public class Question5 {
    public static void main(String[] args) {
        //编写程序输出用户指定数据的所有素数因子
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数");
        int num = sc.nextInt();
        for (int i = 2; i <= num; i++) {
            boolean flag = true;
            for (int j = 2; j < i; j++) {
                if (i % j == 0) {
                    flag = false;
                    break;
                }
            }
            if (flag) {
                System.out.println(i);
            }
        }
    }
}
